var loadContent = function (c_id,c_type,callback) {
	
	switch (c_type) {
		case 'html':
			if (callback!=null) {
				shadowbox_callback = callback;
			}
			Shadowbox.open({
			      player:     'iframe',
			      title:      'Изменение текстового контента',
			      content:    '/cms/html/edit/id/'+c_id,
			      height:     450,
			      width:      750
			  });
			
			break;
			
		case 'plaintext':
			if (callback!=null) {
				shadowbox_callback = callback;
			}
			Shadowbox.open({
			      player:     'iframe',
			      title:      'Изменение html блока',
			      content:    '/cms/html/edit/mode/plaintext/id/'+c_id,
			      height:     450,
			      width:      750
			  });
			
			break;
			
			
		case 'news':
			if (callback!=null) {
				shadowbox_callback = callback;
			}
			Shadowbox.open({
			      player:     'iframe',
			      title:      'Редактирование новостной ленты',
			      content:    '/cms/news/index/id/'+c_id,
			      height:     850,
			      width:      980
			  });
			
			break;
			
		case 'gallery':
			if (callback!=null) {
				shadowbox_callback = callback;
			}
			Shadowbox.open({
			      player:     'iframe',
			      title:      'Редактирование галлереи',
			      content:    '/cms/gallery/index/id/'+c_id,
			      height:     650,
			      width:      700
			  });
			
			break;
			
		case 'bannerlist':
			if (callback!=null) {
				shadowbox_callback = callback;
			}
			Shadowbox.open({
			      player:     'iframe',
			      title:      'Редактирование списка баннеров',
			      content:    '/cms/bannerlist/index/id/'+c_id,
			      height:     650,
			      width:      700
			  });
			
			break;
			
		case 'cover':
			if (callback!=null) {
				shadowbox_callback = callback;
			}
			Shadowbox.open({
			      player:     'iframe',
			      title:      'Редактирование изображения',
			      content:    '/cms/cover/index/id/'+c_id,
			      height:     320,
			      width:      240
			  });
			
			break;
			
		case 'catalog':
			if (callback!=null) {
				shadowbox_callback = callback;
			}
			Shadowbox.open({
			      player:     'iframe',
			      title:      'Редактирование каталога',
			      content:    '/cms/catalog/index/id/'+c_id,
			      height:     850,
			      width:      980
			  });
			
			break;
			
		case 'formsender':
			if (callback!=null) {
				shadowbox_callback = callback;
			}
			Shadowbox.open({
			      player:     'iframe',
			      title:      'Опции формы отправки сообщений',
			      content:    '/cms/formsender/index/id/'+c_id,
			      height:     720,
			      width:      500
			  });
			
			break;
	}
}

var editPageSeoProperties = function (page_id) {
	Shadowbox.open({
	      player:     'iframe',
	      title:      'Редактирование опций по SEO',
	      content:    '/cms/template/seo/id/'+page_id,
	      height:     650,
	      width:      700
	  });	
}

var disableContent = function (im,page_id,content_key) {

	dojo.xhrGet({
		url: "/cms/template/contentdisable/page_id/"+page_id+"/content_key/"+content_key,
		load: function(response, ioArgs){
		  if (parseInt(response)==1) {
			  im.src = '/cms/images/eye_disabled.png';
		  } else {
			  im.src = '/cms/images/eye.png';
		  }
		  return response;
		},
		error: function(response, ioArgs){
		  alert(response);
		  return response;
		},
		handleAs: "text"
	  });
}